using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[RequireComponent(typeof(Rigidbody2D))]
public class LinearMotionEffect : LogicalEffectBase
{
    LinearMotionEffectData data;
    private Rigidbody2D rb2D;
    public override void Init(GameObject originalGameObject, object[] args = null)
    {
        base.Init(originalGameObject, args);
        data = effectData as LinearMotionEffectData;
        rb2D = GetComponent<Rigidbody2D>();
    }
    public override void OnApply()
    {
        rb2D.velocity = transform.right * data.speed;
    }
    public override bool GetLifeState()
    {
        return true;
    }
}
